<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <th:block th:include="include :: header('请假加班列表')" />
</head>
<body class="gray-bg">
     <div class="container-div">
        <div class="row">
            <div class="col-sm-12 search-collapse">
                <form id="formId">
                    <div class="select-list">
                        <ul>
                            <li>
                                <label>姓名：</label>
                                <input type="text" name="params[userName]" />
                            </li>
                            <li>
                                <label>审批类型：</label>
                                <select name="processType" th:with="type=${@dict.getType('dingtalk_process_type')}">
                                    <option value="">所有</option>
                                    <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
                                </select>
                            </li>
                            <li>
                                <label>影响日期：</label>
                                <input type="text" class="time-input" placeholder="请选择影响时间" name="processDate"/>
                            </li>

                            <li>
                                <label>流程ID：</label>
                                <input type="text" name="processInstanceId"/>
                            </li>
                            <li>
                                <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
                                <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
                            </li>
                        </ul>
                    </div>
                </form>
            </div>


            <div class="col-sm-12 select-table table-striped">
                <table id="bootstrap-table"></table>
            </div>
        </div>
    </div>
    <th:block th:include="include :: footer" />
    <script th:inline="javascript">
        var editFlag = [[${@permission.hasPermi('dingtalk:dingtalkProcess:edit')}]];
        var removeFlag = [[${@permission.hasPermi('dingtalk:dingtalkProcess:remove')}]];
        var processTypeDatas = [[${@dict.getType('dingtalk_process_type')}]];
        var prefix = ctx + "dingtalk/dingtalkProcess";

        $(function() {
            var options = {
                url: prefix + "/list",
                createUrl: prefix + "/add",
                updateUrl: prefix + "/edit/{id}",
                removeUrl: prefix + "/remove",
                exportUrl: prefix + "/export",
                showSearch: false,
                showToggle: false,
                showColumns: false,
                showRefresh: false,
                sortName: 'processDate',
                sortOrder: 'DESC',
                modalName: "请假加班",
                columns: [
                {
                    field: 'id',
                    title: '',
                    visible: false
                },
                {
                    field: 'userName',
                    title: '姓名'
                },
                {
                    field: 'processType',
                    title: '审批类型',
                    formatter: function(value, row, index) {
                       return $.table.selectDictLabel(processTypeDatas, value);
                    }
                },
                {
                    field: 'processDate',
                    title: '影响时间'
                },
                {
                    field: 'processHour',
                    title: '影响小时数'
                },
                {
                    field: 'description',
                    title: '备注'
                },
                {
                    field: 'processInstanceId',
                    title: '流程ID'
                },
                {
                    field: 'createAt',
                    title: '创建日期'
                }]
            };
            $.table.init(options);
        });
    </script>
</body>
</html>